﻿using EquipViewAppNet;
using SecsEquip;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace EquipSecs300
{
    public partial class FunctionConfig : CMyFormEx
    {
        SecsFunction Function { get; set; }
        public FunctionConfig()
        {
            InitializeComponent();
        }

       
        public override void UpdateData()
        {
            Function = SecsDataHelper.Function;
            UndateUI();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            Function = RecGrid.SelectedObject as SecsFunction;
            SecsDataHelper.FunctionDAL.Save(Function);
        }

        private void UndateUI()
        {
            RecGrid.SelectedObject = Function;
            RecGrid.Refresh();
        }
    }
}
